<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head> 
	<meta charset="UTF-8">
	<%@ include file="/WEB-INF/views/include/head.jsp"%>
	<link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
	<link rel="stylesheet" href="${ctxStatic}/css/layerSm.css">
	<script src="${ctxStatic}/jquery-barcode/jquery-barcode.js" type="text/javascript"></script>
	<script type="text/javascript">
	
    $(document).ready(function(){
        $("#materialBarCodeDiv").empty().barcode($("#materialBarCode").val(), "code128",{barWidth:2, barHeight:30,showHRI:false});
       });
    
    //删除
    function delMyMaterial(){       
        // 调用后台删除方法
        $.post("${ctx}/material/stock/delete?id=${material.id}",'',function(result){
            // 删除提示信息
            tipParent(result.message);
            // 返回结果
            if(result.statusCode==STATUSCODEOK){
                // 刷新页面
                window.parent.frames[0].searchListForm();
                // 关闭页面
                closeWin(); 
             }
        },'json');
   }
	</script>
</head>
<body>  
	<div class="layerHeader clearfix">
		<p class="headerTitle"><spring:message code="material_showMaterial"/></p>
	    <div class="headerButton clearfix">
	    	<shiro:hasPermission name="material:stock:edit">
	        <button type="button" onClick="window.location.href='${ctx}/material/stock/form?winFlag=1&id=${material.id}'"><spring:message code="material_btn_edit"/></button>
	        <button type="button" onclick="del(delMyMaterial)"><spring:message code="material_btn_dele"/></button>
	    	</shiro:hasPermission>
	        <button onclick="closeWin()"><spring:message code="btn_cancle"/></button>
	    </div>
	</div>

<div class="smList">
  <div class="left w-350">
    <div class="items clearfix">
  	    <!-- 物料编码 -->
        <p class="tit"><spring:message code="material_showMateial_code"/></p>
        <p>${material.materialCode}</p>
    </div>
    <div class="items clearfix">
        <!-- 中文名称 -->
        <p class="tit"><spring:message code="material_showMateial_nameCn"/></p>
        <p data-toggle="tooltip" title="${material.materialNameCn}">${material.materialNameCn}</p>
    </div>
    <div class="items clearfix">
  	    <!-- 来源机构 -->
        <p class="tit"><spring:message code="material_showMateial_ognizationList"/></p>
        <p>${material.ognizationName}</p>
    </div>
    <div class="items clearfix">
  	    <!-- 供货商名称 -->
        <p class="tit"><spring:message code="material_showMateial_supplierName"/></p>
        <p data-toggle="tooltip" title="${material.materialSupplierName}">${material.materialSupplierName}</p>
    </div>
    <div class="items clearfix">
	    <!-- 物料类别 -->
        <p class="tit"><spring:message code="material_showMateial_materialType"/></p>
        <p data-toggle="tooltip" title="${fns:getDictName(material.materialTypeCd)}">${fns:getDictName(material.materialTypeCd)}</p>
    </div>
    <div class="items clearfix">
	    <!-- 物料规格 -->
        <p class="tit"><spring:message code="material_showMateial_spec"/></p>
        <p data-toggle="tooltip" title="${material.materialSpec}">${material.materialSpec}</p>
    </div>
    <div class="items clearfix">
       <!-- 物料克重-->
	   <p class="tit"><spring:message code="material_showMateial_materialGramWeight"/></p>
	   <p>${material.materialGramWeight}</p>
	   <%-- <p data-toggle="tooltip" title="<fmt:formatNumber value="${material.materialGramWeight}" pattern="#,#00.00#"/>"><fmt:formatNumber value="${material.materialGramWeight}" pattern="#,#00.00#"/></p> --%>
    </div>
    <%-- <div class="items clearfix">
	    <!-- 物料款式 -->
        <p class="tit"><spring:message code="material_showMateial_style"/></p>
        <p>
        <c:forEach items="${fn:split(material.materialStyleCategory,',')}" var="selectStyle" >
          ${fns:getDictName(selectStyle)}
        </c:forEach>
        </p>
    </div> --%>
    <div class="items clearfix">
        <!-- 物料季节 -->
        <p class="tit"><spring:message code="material_showMateial_season"/></p>
        <p>${material.materialYear}${fns:getDictName(material.materialSeason)}</p>
    </div>
    <div class="items clearfix">
       <!-- 物料颜色 -->
       <p class="tit"><spring:message code="material_showMateial_color"/></p>
       <p data-toggle="tooltip" title="${material.materialColor}">
			<c:forEach items="${fn:split(material.materialColor,',')}" var="color" varStatus="status">
				<c:if test="${status.index != 0}">,</c:if>
				${fns:getDictName(color) }
			</c:forEach>
       </p>
    </div>
    <div class="items clearfix">
		<!-- 纱织密度 -->
       <p class="tit"><spring:message code="material_showMateial_threadCount"/></p>
       <p>${material.materialThreadCount}</p>
	</div>
    <div class="items clearfix">
        <!-- 物料织法 -->
        <p class="tit"><spring:message code="material_showMateial_knitMethod"/></p>
        <p>${fns:getDictName(material.materialKnitMethod)}</p>
    </div>
    <div class="items clearfix">
		<!-- 样品物料 -->
        <p class="tit"><spring:message code="material_showMateial_sample"/></p>
        <c:if test="${material.materialSample=='1'}">
            <p class="tit"><spring:message code="material_showMateial_materialSample"/></p>
        </c:if>
	</div>
      <div class="items clearfix">
          <!-- 缝制线色 -->
          <p class="tit"><spring:message code="material_showThread_color"/></p>
          <p data-toggle="tooltip" title="${fns:getDesignoptionName(fn:split(material.materialOther3,'-')[1])}">${fns:getDesignoptionName(fn:split(material.materialOther3,'-')[1])}</p>
      </div>
      <div class="items clearfix">
          <!-- 缝线规格 -->
          <p class="tit"><spring:message code="material_showThread_thinkness"/></p>
          <p data-toggle="tooltip" title="${fns:getDesignoptionName(fn:split(material.materialOther4,'-')[1])}">${fns:getDesignoptionName(fn:split(material.materialOther4,'-')[1])}</p>
      </div>
      <div class="items clearfix">
          <!-- 扣号 -->
          <p class="tit">扣号</p>
          <p data-toggle="tooltip" title="${material.materialOther5}">${material.materialOther5}</p>
      </div>
      <div class="items clearfix">
		<!-- 面料厚度 -->
       <p class="tit">面料厚度</p>
       <p>${material.materialOther6}</p>
	</div>
	<div class="items clearfix">
		<!-- 面料弹力 -->
       <p class="tit">面料弹力</p>
       <p>${material.materialOther7}</p>
	</div>
    <div class="items clearfix">
       <!-- 描述 -->
       <p class="tit"><spring:message code="material_showMateial_remarks"/></p>
       <p data-toggle="tooltip" title="${material.remarks}">${material.remarks}</p>
    </div>        
  </div>
  <div class="right w-350">
    <div class="items clearfix">
       <!-- 使用类别 -->
       <p class="tit"><spring:message code="material_showMateial_useType"/></p>
       <p>${fns:getDictName(material.materialType)}</p>
    </div>
    <div class="items clearfix">
 	    <!-- 物料条形码 -->
        <p class="tit"><spring:message code="material_showMateial_barCode"/></p>
        <div id="materialBarCodeDiv"></div>
        <input type="hidden" id="materialBarCode" name="materialBarCode" value="${material.materialBarCode}"> 
    </div>
    <div class="items clearfix">
       <!-- 物料产地 -->
       <p class="tit"><spring:message code="material_showMateial_produced"/></p>
       <p data-toggle="tooltip" title="${material.materialProduced}">${material.materialProduced}</p>
    </div>
    <div class="items clearfix">
       <!-- 客户品牌-->
       <p class="tit"><spring:message code="material_showMateial_brandName"/></p>
       <p>${material.brandCn}</p>
    </div>
    <div class="items clearfix">
       <!-- 来源类别-->
       <p class="tit"><spring:message code="material_showMateial_source"/></p>
       <p>${fns:getDictName(material.materialSource)}</p>
    </div>
    <div class="items clearfix">
       <!-- 物料成分 -->
       <p class="tit"><spring:message code="material_showMateial_texture"/></p>
       <c:set value="${fn:split(material.materialComposition,'-')[0]}${'-'}" var="compositionHead"/>
       <c:set value="${fns:getDesignoptionName(fn:replace(material.materialComposition,compositionHead,''))}" var="composition"/>
       <p data-toggle="tooltip" title="${composition}">${composition}</p>
    </div>	
    <div class="items clearfix">
	   <!-- 物料单位 -->
	   <p class="tit"><spring:message code="material_showMateial_unit"/></p>
	   <p>${fns:getDictName(material.materialUnitCd)}</p>
    </div>
    <div class="items clearfix">
	   <!-- 物料针码 -->
	   <p class="tit">物料针码</p>
	   <p>${fns:getDesignoptionName(fn:split(material.materialStitch,'-')[1])}</p>
    </div>
    <div class="items clearfix">
       <!-- 物料等级 -->
       <p class="tit"><spring:message code="material_showMateial_materialLevel"/></p>
       <p>${fns:getDictName(material.materialLevel)}</p>
    </div>
    <div class="items clearfix">
		<!-- 物料用途 -->
        <p class="tit"><spring:message code="material_showMateial_materialUseType"/></p>
        <p>${fns:getDictName(material.materialUseType)}</p>
	</div>
    <div class="items clearfix">
		<!-- 物料风格 -->
        <p class="tit"><spring:message code="material_showMateial_materialStyle"/></p>
        <p>${fns:getDictName(material.materialStyle)}</p>
	</div>
    <%-- <div class="items clearfix">
       <!-- 物料部位 -->
       <p class="tit"><spring:message code="material_showMateial_placement"/></p>
       <p>
         <c:forEach items="${fn:split(material.materialPlacement,',')}" var="selectPlacement" >
         ${fns:getDictName(selectPlacement)}
         </c:forEach>
        </p>
    </div> --%>
    <div class="items clearfix">
       <!-- 状态 -->
       <p class="tit"><spring:message code="common_status"/></p>
       <p>
         <c:if test="${material.enableFlag eq 1}"><spring:message code="dict_enable"/></c:if>
         <c:if test="${material.enableFlag eq 0}"><spring:message code="dict_disable"/></c:if>
        </p>
    </div>
    <div class="items clearfix">
       <!-- 物料图片 -->
       <p class="tit"><spring:message code="material_show_pic"/></p>
       <div style="height:142px;">
          <c:if test="${not empty material.uploadFile.showImgUrl}">
             <img src="${material.uploadFile.showImgUrl}" width='140' height='140' class="tableImg">
          </c:if>
          <c:if test="${empty material.uploadFile.showImgUrl}">
             <img src="${ctxStatic}/images/pic-none.jpg" width='140' height='140'>
          </c:if>
       </div>
    </div>
  </div>
</div>
</body>
</html>
